package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread t=new Thread(){
            public void run(){
                String name=this.getName();
                System.out.println(name);
                long id=this.getId();//唯一标识
                System.out.println(id);
                int priority=this.getPriority();
                System.out.println(priority);
                //线程是否被中断
                boolean isInterrupted= this.isInterrupted();
                System.out.println(isInterrupted);
                //线程是否为守护线程
                boolean isDaemon=this.isDaemon();
                System.out.println(isDaemon);
                //线程是否还活着
                boolean isAlive=this.isAlive();
                System.out.println("是否还活着："+isAlive);

            }
        };
        t.start();
    }
}
